package com.ald.crossex.utils;

import com.ald.crossex.dto.JqGridResponse;
import com.ald.crossex.util.Page;

/**
 * Created by lishijiong on 15/1/29.
 */
public class PageUtils {


    /**
     * 返回翻页数据转化
     * @param page
     * @return
     */
    public static JqGridResponse pageToJqGridResponse(Page page){
        JqGridResponse response = new JqGridResponse();

        response.setRows(page.getRows());
        response.setPage(page.getPageIndex());
        response.setRecords(page.getTotalCount());
        response.setTotal(page.getPageCount());
        response.setRepeatitems(true);

        return response;
    }
}
